<!DOCTYPE html>
<html>
<head runat="server">
    <include file="./public/sty.html"/>
    <style>
        a:hover, a:link {
            color: black;
        }

        button {
            padding: 10px 50px;
            background: #71b576;
            color: #fff;
            border: none;
        }

        button:hover {
            background: #4c7a4f;
        }

    </style>
</head>
<body>
<div id="app" class="alipay">
    <include file="./public/header.html"/>

    <div class="container containerUser fix pt15" s="[object Object]">
        <div class="slideUser">
            <ul class="sildeSession"><h3><span></span>账号管理</h3>
                <li class=""><a href="{:U('Users/personalInfo')}">个人信息</a></li>
                <li class="curr"><a href="{:U('Users/securityCenter')}">安全中心</a></li>
                <li class=""><a href="{:U('Users/manageBankcard2')}">银行卡管理</a></li>
            </ul>
            <ul class="sildeSession"><h3><span></span>投注管理</h3>
                <li><a href="{:U('Users/BetRecord')}" class="">投注记录</a></li>
                <li><a href="{:U('Users/seekOrder')}" class="">追号记录</a></li>
            </ul>
            <ul class="sildeSession"><h3><span></span>资金管理</h3>
                <li><a href="{:U('Users/BillRecord')}" class="">交易记录</a></li>
                <li class=""><a href="{:U('Users/PLstatement')}">今日盈亏</a></li>
            </ul>
            <?php if($wanjia['utype'] == '1'){ ?>
            <ul class="sildeSession">
                <h3><span></span>代理中心</h3>
                <li><a href="{:U('Users/agentIntro')}" class="">代理说明</a></li>
                <li class=""><a href="{:U('Users/agentReport')}">代理报表</a></li>
                <li><a href="{:U('Users/lowerReport')}" class="">下级报表</a></li>
                <li class=""><a href="{:U('Users/manageInvite')}">下级开户</a></li>
                <li><a href="{:U('Users/agentMember')}" class="">会员管理</a></li>
                <li><a href="{:U('Users/agentBetRecord')}" class="">投注明细</a></li>
                <li><a href="{:U('Users/agentBillRecord')}" class="">交易明细</a></li>
            </ul>
            <?php }?>
            <ul class="sildeSession"><h3><span></span>消息管理</h3>
                <li><a href="{:U('Users/letter')}" class="">站内信</a></li>
                <li><a href="{:U('Users/Notice')}" class="">网站公告</a></li>
            </ul>
        </div>

        <div data-v-e0a515bc="" class="userRight">
            <div data-v-e0a515bc="" class="userTitle mgb10">我要充值</div>
            <div data-v-e0a515bc="" class="newTab pt15 fix">
                <a href="{:U('Index/ebankPay')}" class="" data-v-e0a515bc="">银行转账</a>
                <a href="{:U('Index/alipay')}" class="" data-v-e0a515bc="">支付宝充值</a>
                <a href="{:U('Index/wechatPay')}" class="" data-v-e0a515bc="">微信支付</a>
                <a href="{:U('Index/scanPay')}" class="curr curr" data-v-6bb4bdc2="">扫码支付</a>
            </div>
            <div class="main" style="margin-top: 80px;margin-left: 80px;float:left;">
                <form target="_blank" method="" action="">
                    <ul>
                        <li>
                            <span >订单金额</span>
                            <input type="text" id="amount" style="border: 1px solid lightgrey;width: 120px;height: 30px;margin-left: 20px" />
                        </li>
                        <li>
                            <span>二维码类型</span>
                            <select id="typeid" style="width: 120px;height: 30px;margin-left: 9px;margin-top: 10px" >
                                 <foreach name="type_array" item="v">
                                        <option value="{$v.key}">{$v.val}</option>
                                 </foreach>
                            </select>
                        </li>
						<input type="hidden" id="paytype" value="{$id}">
                        <li style="margin-top: 50px;margin-left: 20px">
                            <button type="button" onclick="tijiao()">获取二维码</button>
                        </li>
                    </ul>
                </form>
            </div>
			<div  class="ewm" style="width:250px;height:260px;border:1px solid;float:right;margin-top:80px;margin-right:80px;display:none">
				  <h3 style="text-align: center;">扫码支付</h3>
                           <div style="margin-left:25px;" id="showqrcode"></div>
                  </div>
             </div>
        </div>
    </div>
    <div data-v-e0a515bc="" class="layerBg" style="display: none;"></div>

<div id="tishi1" class="layermbox layermbox0 layermshow" index="11">
    <div class="laymshade"></div>
    <div class="layermmain">
        <div class="section">
            <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                <button class="layermend"></button>
                <div class="layermcont">·充值金额不能为空·</div>
                <div class="layermbtn"><span type="1">确定</span></div>
            </div>
        </div>
    </div>
</div>
<div id="tishi2" class="layermbox layermbox0 layermshow" index="11">
    <div class="laymshade"></div>
    <div class="layermmain">
        <div class="section">
            <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                <button class="layermend"></button>
                <div class="layermcont">·金额格式不正确·</div>
                <div class="layermbtn"><span type="1">确定</span></div>
            </div>
        </div>
    </div>
</div>
<div id="tishi3" class="layermbox layermbox0 layermshow" index="11">
    <div class="laymshade"></div>
    <div class="layermmain">
        <div class="section">
            <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                <button class="layermend"></button>
                <div class="layermcont">·参数缺少·</div>
                <div class="layermbtn"><span type="1">确定</span></div>
            </div>
        </div>
    </div>
</div>
<div id="tishi4" class="layermbox layermbox0 layermshow" index="11">
    <div class="laymshade"></div>
    <div class="layermmain">
        <div class="section">
            <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                <button class="layermend"></button>
                <div class="layermcont">·请填写正规的金额数值·</div>
                <div class="layermbtn"><span type="1">确定</span></div>
            </div>
        </div>
    </div>
</div>
<div id="tishi5" class="layermbox layermbox0 layermshow" index="11">
    <div class="laymshade"></div>
    <div class="layermmain">
        <div class="section">
            <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                <button class="layermend"></button>
                <div class="layermcont">·该支付方式已失效·</div>
                <div class="layermbtn"><span type="1">确定</span></div>
            </div>
        </div>
    </div>
</div>
<div id="tishi6" class="layermbox layermbox0 layermshow" index="11">
    <div class="laymshade"></div>
    <div class="layermmain">
        <div class="section">
            <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                <button class="layermend"></button>
                <div class="layermcont">·二维码生成失败·</div>
                <div class="layermbtn"><span type="1">确定</span></div>
            </div>
        </div>
    </div>
</div>

</div>

  <include file="./public/footer.html"/>
</div>
</body>
</html>
<script type="text/javascript" src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<script src="/style/js/qrcode.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/payapi/zhitongbao/js/jquery-1.8.0.js"></script>
<script type="text/javascript" src="__PUBLIC__/payapi/zhitongbao/js/jquery.qrcode.js"></script>
<script type="text/javascript" src="__PUBLIC__/payapi/zhitongbao/js/utf.js"></script>
<script src="/style/js/jquery.min.js"></script>
<script src="/style/js/fx.js"></script>
<script type="text/javascript">
    $(function(){
        $(".bank-list img").on("click", function() {
            $(".bank-list input[type='radio']").prop("checked", false);
            $(this).prev("input[type='radio']").prop("checked", true);
        })
    })
	function tijiao(){
        var money = $("#amount").val();
        var paytype = $("#paytype").val();
        var typeid = $("#typeid").val();
        if(money=="" ){
//            alert("充值金额不能为空");
            $("#tishi1").show();
            return false;
        }
        var reg = /^[0-9]+(.[0-9]+)?$/; //   ^[0-9]+(.[0-9]{2})?$  限制小数点
        if(!reg.test(money)){
            $("#tishi2").show();
//            alert("金额格式不正确");
            return false;
        } 
        $.ajax({
            type: "POST",
            url: "{:U('Index/doScanPay')}",
            data: {'amount': money,'paytype': paytype,'typeid': typeid},
            success: function (e) {
               if(e==1){
//			       alert("参数缺少！");
                   $("#tishi3").show();
			   }else if(e==2){
//				   alert("请填写正规的金额数值!");
                   $("#tishi4").show();
			   }else if(e==3){
//				   alert("该支付方式已失效!");
                   $("#tishi5").show();
			   }else if(e==4){
//				   alert("二维码生成失败!");
                   $("#tishi6").show();
			   }else{
				   $(".ewm").show();
			        sQrcode(e);
			   }
            }
        });
    }
	function sQrcode(qdata){
	$("#showqrcode").empty().qrcode({		// 调用qQcode生成二维码
			render : "canvas",    			// 设置渲染方式，有table和canvas，使用canvas方式渲染性能相对来说比较好
			text : qdata,    				// 扫描了二维码后的内容显示,在这里也可以直接填一个网址或支付链接
			width : "200",              	// 二维码的宽度
			height : "200",             	// 二维码的高度
			background : "#ffffff",     	// 二维码的后景色
			foreground : "#000000",     	// 二维码的前景色
			src: ""    						// 二维码中间的图片
		});		
}
</script>
